//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package common;

public class LogicLong {
  private int higherInt;
  private int lowerInt;

  public LogicLong() {
    this.higherInt = 0;
    this.lowerInt = 0;
  }

  public LogicLong(int h, int l) {
    this.higherInt = h;
    this.lowerInt = l;
  }

  public LogicLong(long ll) {
    this.higherInt = (int)(ll >>> 32);
    this.lowerInt = (int)ll;
  }

  public int getHigherInt() {
    return this.higherInt;
  }

  public int getLowerInt() {
    return this.lowerInt;
  }

  public boolean isZero() {
    return this.higherInt == 0 && this.lowerInt == 0;
  }

  public boolean equals(LogicLong ll) {
    return this.higherInt == ll.higherInt && this.lowerInt == ll.lowerInt;
  }

  public long longValue() {
    return (long)this.higherInt << 32 | (long)this.lowerInt & 4294967295L;
  }

  public void decode(ByteStream bs) {
    this.higherInt = bs.readInt();
    this.lowerInt = bs.readInt();
  }

  public void encode(ChecksumEncoder cse) {
    cse.writeInt(this.higherInt);
    cse.writeInt(this.lowerInt);
  }

  public String toString() {
    return String.valueOf(this.longValue());
  }
}
